<cfset config.faVariable = application.fusebox.fuseactionVariable/>
<cfset currentFa = caller.myfusebox.ORIGINALFUSEACTION/>
<cfset config.currentCircuit = caller.myfusebox.ORIGINALCIRCUIT/>
	
<!--- Processing Name --->
<cfif NOT structKeyExists(attributes,"name")>
	<cfif structKeyExists(attributes,"id")>
		<cfset attributes.name=attributes.id/>
	<cfelseif structKeyExists(attributes,"action")>
		<cfset fa = listFirst(attributes.action,"&?")/>		
		<!--- apply to action like create and create&id=10--->				
		<cfif listlen(fa,'.') eq 1>
			<cfset attributes.name = fa/>
		<!--- apply to action like mem.create and mem.create&id=10, but not index.cfm or index.cfm?fuseaction=mem.create --->
		<cfelseif listlen(fa,'.') eq 2 AND compareNoCase(config.index,fa)>
			<cfset attributes.name = listLast(fa,'.')/>
		<cfelse>
			<cfset faPosition = listFindNoCase(attributes.action, config.faVariable, "?=&.")/>			
			<cfif faPosition>
				<cfset attributes.name = listGetAt(attributes.action,faPosition+2,'?=&.')/>
			</cfif>
		</cfif>
	<cfelseif isDefined("request.ui.form.#tag#.html") and structKeyExists(request.ui.form[tag].html,'name')>
		<cfset attributes.name = request.ui.form[tag].html.name/>
	<cfelse>
		<cfset attributes.name = currentFa/>
	</cfif>
</cfif>
<cfparam name="attributes.action" default="#setValue('name','',attributes)#"/>
<!--- End processing name --->


<!--- *** CONFIG VARIABLES *** --->
<!--- Adding config variables for specific form name --->
<cfset structAppend(config,getConfig(tag,attributes,request),false)/>

<!--- *** HTML VARIABLES *** --->
<!--- Adding html variables for specific form name --->
<cfset attributes = getHtml(tag,attributes,request)/>

<cfinclude template="action.cfm"/>

<cfif listFirst(config.cancelURL,'?&') neq config.index>
	<cfif listLen(listFirst(config.cancelURL,'&'),'.') eq 2>
		<cfset config.cancelURL = config.index & "?" & config.faVariable & "=" & config.cancelURL/>
	<cfelse>
		<cfset config.cancelURL = config.index & "?" & config.faVariable & "=" & config.currentCircuit & "." & config.cancelURL/>
	</cfif>
</cfif>